package com.xingtu.testSerialport.dialog;

import android.app.Dialog;
import android.content.Context;
import android.widget.ImageView;

import com.xingtu.testSerialport.R;
import com.zcx.helper.glide.GlideLoader;

/**
 * 网络加载 gif
 */
public class LoadingDialog extends Dialog {

    private ImageView imageView;
    private Context context;


    public LoadingDialog(Context context) {

        super(context, R.style.Transparent_Dialog);

        setContentView(R.layout.dialog_loading);

        this.context = context;

        imageView = (ImageView) findViewById(R.id.load_image);

        setCancelable(true);

        setCanceledOnTouchOutside(false);

    }

    @Override
    public void dismiss() {
        super.dismiss();
    }

    @Override
    protected void onStart() {
        super.onStart();
        GlideLoader.getInstance().loadImgGifId(context,R.mipmap.loading,imageView);
    }


}
